/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Elias Mendoza
 */
@Entity
@Table(name = "sensores")
@NamedQueries({
  @NamedQuery(name = "Sensores.findAll", query = "SELECT s FROM Sensores s"),
  @NamedQuery(name = "Sensores.findById", query = "SELECT s FROM Sensores s WHERE s.id = :id"),
  @NamedQuery(name = "Sensores.findByNoReg", query = "SELECT s FROM Sensores s WHERE s.noReg = :noReg"),
  @NamedQuery(name = "Sensores.findByIdSensor", query = "SELECT s FROM Sensores s WHERE s.idSensor = :idSensor"),
  @NamedQuery(name = "Sensores.findByHumedad", query = "SELECT s FROM Sensores s WHERE s.humedad = :humedad"),
  @NamedQuery(name = "Sensores.findByVr1", query = "SELECT s FROM Sensores s WHERE s.vr1 = :vr1"),
  @NamedQuery(name = "Sensores.findByFecha", query = "SELECT s FROM Sensores s WHERE s.fecha = :fecha"),
  @NamedQuery(name = "Sensores.findByHora", query = "SELECT s FROM Sensores s WHERE s.hora = :hora"),
  @NamedQuery(name = "Sensores.findByValRiego", query = "SELECT s FROM Sensores s WHERE s.valRiego = :valRiego"),
  @NamedQuery(name = "Sensores.findBySustrato", query = "SELECT s FROM Sensores s WHERE s.sustrato = :sustrato"),
  @NamedQuery(name = "Sensores.findByNd", query = "SELECT s FROM Sensores s WHERE s.nd = :nd")})
public class Sensores implements Serializable {
  private static final long serialVersionUID = 1L;
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Basic(optional = false)
  @Column(name = "id")
  private Integer id;
  @Basic(optional = false)
  @Column(name = "no_reg")
  private int noReg;
  @Basic(optional = false)
  @Column(name = "id_sensor")
  private String idSensor;
  @Basic(optional = false)
  @Column(name = "humedad")
  private double humedad;
  @Basic(optional = false)
  @Column(name = "vr1")
  private double vr1;
  @Basic(optional = false)
  @Column(name = "fecha")
  @Temporal(TemporalType.DATE)
  private Date fecha;
  @Basic(optional = false)
  @Column(name = "hora")
  @Temporal(TemporalType.TIME)
  private Date hora;
  @Basic(optional = false)
  @Column(name = "val_riego")
  private String valRiego;
  @Basic(optional = false)
  @Column(name = "sustrato")
  private String sustrato;
  @Basic(optional = false)
  @Column(name = "nd")
  private int nd;

  public Sensores() {
  }

  public Sensores(Integer id) {
    this.id = id;
  }

  public Sensores(Integer id, int noReg, String idSensor, double humedad, double vr1, Date fecha, Date hora, String valRiego, String sustrato, int nd) {
    this.id = id;
    this.noReg = noReg;
    this.idSensor = idSensor;
    this.humedad = humedad;
    this.vr1 = vr1;
    this.fecha = fecha;
    this.hora = hora;
    this.valRiego = valRiego;
    this.sustrato = sustrato;
    this.nd = nd;
  }

  public Integer getId() {
    return id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  public int getNoReg() {
    return noReg;
  }

  public void setNoReg(int noReg) {
    this.noReg = noReg;
  }

  public String getIdSensor() {
    return idSensor;
  }

  public void setIdSensor(String idSensor) {
    this.idSensor = idSensor;
  }

  public double getHumedad() {
    return humedad;
  }

  public void setHumedad(double humedad) {
    this.humedad = humedad;
  }

  public double getVr1() {
    return vr1;
  }

  public void setVr1(double vr1) {
    this.vr1 = vr1;
  }

  public Date getFecha() {
    return fecha;
  }

  public void setFecha(Date fecha) {
    this.fecha = fecha;
  }

  public Date getHora() {
    return hora;
  }

  public void setHora(Date hora) {
    this.hora = hora;
  }

  public String getValRiego() {
    return valRiego;
  }

  public void setValRiego(String valRiego) {
    this.valRiego = valRiego;
  }

  public String getSustrato() {
    return sustrato;
  }

  public void setSustrato(String sustrato) {
    this.sustrato = sustrato;
  }

  public int getNd() {
    return nd;
  }

  public void setNd(int nd) {
    this.nd = nd;
  }

  @Override
  public int hashCode() {
    int hash = 0;
    hash += (id != null ? id.hashCode() : 0);
    return hash;
  }

  @Override
  public boolean equals(Object object) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if (!(object instanceof Sensores)) {
      return false;
    }
    Sensores other = (Sensores) object;
    if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
      return false;
    }
    return true;
  }

  @Override
  public String toString() {
    return "modelo.Sensores[ id=" + id + " ]";
  }
  
}
